package com.whcoding.base.project.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author Manager
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Accessors(chain=true) //链式写法
public class OrmDeptCondition extends BaseVO implements Serializable {
    private Long id;
    @Min(value =0,message = "最小值不能小于0")
    private Integer deptId;

    @NotBlank(message="部门编码不能为空")
    private String deptNo;

    @NotNull(message = "部门名称不能为空")
    private String deptName;

	private Integer deptType;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date updateTime;

    @DecimalMin(value = "1", message = "部门绩效金额必须大于等于1")
    private BigDecimal deptPerf;

    private Integer isValidFlag;

    @NotEmpty(message = "必须不为null且不为空")
    private String shortName;

    @Null(message = "必须为null")
    private String remark;

    //正则校验邮箱
//    @Pattern(regexp = "^[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*@([a-zA-Z0-9]+[-.])+[a-zA-Z0-9]{2,5}$")
    @Email(message="邮箱格式不正确")
    private String email;


    private List<String> deptNoList;

}
